<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>今日到岗榜</title>
</head>
<body>

<script type="text/javascript" src="./$.js"></script>
<script>
    require(['!this.js'], $$.load)
</script>
</body>
</html>

<!--tpl部分-->
<template data-name="this.htm">
    <div class="arrive" v-if="data">
        <div class="con" v-if="data.length!=0">
            <div class="arriveItem" v-for="(value,i) in data" v-if="data">
                <div v-if="i==0||i==1||i==2">
                    <div v-if="i==0">
                        <img src="../$res/imgers/medal_gold.png">
                    </div>
                    <div v-if="i==1">
                        <img src="../$res/imgers/medal_silver.png">
                    </div>
                    <div v-if="i==2">
                        <img src="../$res/imgers/medal_copper.png">
                    </div>
                </div>
                <span v-else>{{i+1}}</span>

                <div class="aIContent">
                    <img v-if="value.avatar!=null" :src="value.avatar">
                    <img v-else src="../$res/imgers/default_img.png">
                    <div class="detail">
                        <div class="name">{{value.name}}</div>
                        <div class="team">{{value.dept}}</div>
                    </div>
                    <div class="time_gold">{{value.time}}</div>
                </div>
            </div>
        </div>
        <div class="no_con" v-else>
            <img src="/rs/kaoqin/$res/imgers/no.png" alt="">
            <p>还没有人来上班哦~</p>
        </div>
    </div>
</template>

<!--JS部分-->
<script data-name="this.js">

    function get_data() {
        $$.ajax({
            url: "/kaoqin/dashboards/earliest",
            data: {},
            result: {
                $200: function (ret) {
                    weui.loading().hide();
                    $$.m.data = ret.data;
                }
            }
        });
    }
    require('../$res/js/common');
    module.exports = {
        template: require('!this.htm'),
        methods: {},
        loaded: function () {
            $$.m = {
                data: false
            };
            weui.loading('加载中');
        },
        mounted: function () {
            get_data();
        }
    };

</script>